package question17;

public class Student {
    private String name;
    private int ID;
    private int function;

    public Student() {
    }

    public Student(String name, int ID, int function) {
        this.name = name;
        this.ID = ID;
        this.function = function;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getID() {
        return ID;
    }

    public void setID(int ID) {
        this.ID = ID;
    }

    public int getFunction() {
        return function;
    }

    public void setFunction(int function) {
        if (function<0){
            throw new MyException("分数不能为负");
        }
       else this.function = function;
    }
}
